package com.browser.bookmark;

import lombok.Data;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

@Data
public class BookmarkFolder {
    private final String id;
    private final String name;
    private final BookmarkFolder parent;
    private final List<Bookmark> bookmarks;
    private final List<BookmarkFolder> folders;

    public BookmarkFolder(String name, BookmarkFolder parent) {
        this.id = UUID.randomUUID().toString();
        this.name = name;
        this.parent = parent;
        this.bookmarks = new ArrayList<>();
        this.folders = new ArrayList<>();
    }

    public void addBookmark(Bookmark bookmark) {
        bookmarks.add(bookmark);
    }

    public void addFolder(BookmarkFolder folder) {
        folders.add(folder);
    }

    public List<Bookmark> getBookmarks() {
        return new ArrayList<>(bookmarks);
    }

    public List<BookmarkFolder> getFolders() {
        return new ArrayList<>(folders);
    }
} 